package org.example.maven.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.maven.pojo.operation.OperateList;
import org.example.maven.pojo.operation.OperationLog;
import org.example.maven.pojo.operation.SearchOperate;

import java.util.List;

@Mapper
public interface OperateMapper {
    //添加操作日志
    @Insert("insert into operation_log(user_id,operate_time,operate_type,operate_detail,ip_address,do_time,operate_result)" +
            "values (#{userId},#{operateTime},#{operateType},#{operateDetail},#{ipAddress},#{doTime},#{operateResult})")
    void addOperateLog(OperationLog operationLog);

    //获取操作日志的信息
    @Select("select *from user_operate")
    List<OperateList> getOperateList();

    //获取特定的total值
    Integer getOperateCount(SearchOperate searchOperate);

    //获取特定的日志
    List<OperateList> getSpecieOperation(SearchOperate searchOperate);

    //删除日志
    void deleteOperation(String[]id);

    //删除全部日志
    @Delete("delete from operation_log")
    void deleteOperationAll();
}
